﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpringEngine
{
    public struct MotionVector
    {
        public double X { get; set; }
        public double Y { get; set; }

        public MotionVector(double x, double y) : this()
        {
            X = x;
            Y = y;
        }

        public override string ToString()
        {
            return String.Format("[{0}, {1}]", X, Y);
        }

        public static MotionVector operator+(MotionVector a, MotionVector b)
        {
            return new MotionVector
                       {
                           X = a.X + b.X, 
                           Y = a.Y + b.Y
                       };
        }
        public static MotionVector operator -(MotionVector a, MotionVector b)
        {
            return new MotionVector
            {
                X = a.X - b.X,
                Y = a.Y - b.Y
            };
        }
        public static MotionVector operator*(MotionVector a, double b)
        {
            return new MotionVector
                       {
                           X = a.X*b,
                           Y = a.Y*b,
                       };
        }
        public static MotionVector operator /(MotionVector a, double b)
        {
            return new MotionVector
            {
                X = a.X / b,
                Y = a.Y / b,
            };
        }
    }

    //public struct VectorPart
    //{
    //    public double Value { get; set; }
    //    public double Power { get; set; }
    //}
}
